• detect line ends
  • connect line ends

In [1]:
from skimage import exposure
from skimage.color import rgb2gray
from skimage.filter.rank import mean_bilateral
from skimage import img_as_ubyte
from skimage.morphology import disk

from utils.image_plot import *

In [12]:
path = r'..\media\blobs_3_opening.bmp'

im = imread(path)
im_grey = rgb2gray(im)

im_uint = img_as_ubyte(im_grey).astype(np.uint16)
result = mean_bilateral(im_uint, disk(20), s0=10, s1=10)

In [11]:
fig, ax = subplots(figsize=(20, 10))
ax.imshow(result, cmap='Greys',  interpolation='nearest')


Out[11]:
<matplotlib.image.AxesImage at 0x72b4db0>

In [7]:
show_im(result, 'test', 620, 700, 355, 470)



In [ ]: